<?php slot('user','active'); ?>
<?php // include_partial('global/flash'); ?>
<div class="row-fluid">
        <div class="box span12">
                <div class="box-header">
                        <h2><i class="icon-edit"></i>添加用户限额</h2>
                        <div class="box-icon"></div>
                </div>
                <div class="box-content">
                  <?php if($sf_user->hasFlash('error')): ?>
                  <div class="alert alert-error">
                          <button type="button" class="close" data-dismiss="alert">×</button>
                          <strong>错误！</strong>  <?php echo $sf_user->getFlash('error'); ?>
                  </div>
                  <?php endif; ?>
                  <?php if($sf_user->hasFlash('success')): ?>
                  <div class="alert alert-success">
                          <button type="button" class="close" data-dismiss="alert">×</button>
                          <strong>操作成功！</strong> <?php echo $sf_user->getFlash('success'); ?>
                  </div>
                  <?php endif; ?>

                        <form class="form-horizontal" action="<?php echo url_for('user/save_quota'); ?>" method="post">
                          <fieldset>
                              <div class="control-group">
                                    <label class="control-label">用户名:</label>
                                    <div class="controls">
                                      <span class="input-xlarge uneditable-input"><?php echo $user->getUserName(); ?></span>
                                      <a href="<?php echo url_for('user/show_user_info?id='.$user->getId()); ?>">资料预览</a>
                                    </div>
                              </div>
                            <div class="control-group">
								<label class="control-label">共有限额</label>
								<div class="controls">
								  <span class="input-xlarge uneditable-input" ><?php echo number_format($user_account->getQuota(),4); ?></span>
                                  <span class="help-inline">
                                  </span>
								</div>
							  </div>
                            <div class="control-group">
								<label class="control-label">已用限额</label>
								<div class="controls">
								  <span class="input-xlarge uneditable-input" ><?php echo number_format($user_account->getUseQuota(),4); ?></span>
                                  <span class="help-inline"></span>
								</div>
							  </div>
                            <div class="control-group">
								<label class="control-label">剩余限额</label>
								<div class="controls">
								  <span class="input-xlarge uneditable-input" ><?php echo number_format($user_account->getSurplusQuota(),4); ?></span>
                                  <span class="help-inline"></span>
								</div>
							  </div>
                                <div class="control-group">
                                        <label class="control-label" for="focusedInput">账户限额</label>
                                        <div class="controls">
                                          <input class="input-xlarge focused" id="focusedInput" type="text" value="<?php echo number_format(0,2); ?>" name="limit_money" />元
                                          <span class="help-inline">建议：输入数值小数点位数只到小数点后2位。限额不能小于1000</span>
                                        </div>
                                  </div>
                               <input type="hidden" name="user_id" value="<?php echo $user->getId(); ?>" />
                                <div class="form-actions">
                                  <input type="submit" value="保存数据" class="btn btn-primary">
                                  <button type="reset" class="btn" onclick="window.location.href='<?php echo url_for('user/index'); ?>';">返回列表</button>
                                </div>
                          </fieldset>
                        </form>   

                </div>
        </div><!--/span-->
</div>

<div class="row-fluid">	
				<div class="box span12">
					<div class="box-header">
						<h2><i class="icon-align-justify"></i><span class="break"></span>用户限额添加记录</h2>
						<div class="box-icon">
<!--							<a href="#" class="btn-setting"><i class="icon-wrench"></i></a>
							<a href="#" class="btn-minimize"><i class="icon-chevron-up"></i></a>-->
							<a href="#" class="btn-close"><i class="icon-remove"></i></a>
						</div>
					</div>
					<div class="box-content">
						<table class="table table-bordered table-striped table-condensed">
							  <thead>
								  <tr>
									  <th>操作人</th>
									  <th>添加限额</th>
									  <th>添加时间</th>                                       
								  </tr>
							  </thead>   
							  <tbody>
                                                              <?php foreach($user_quotas as $quota): ?>
								<tr>
									<td><?php echo $quota->getActionUser(); ?></td>
									<td class="center"><?php echo $quota->getLimitMoney(); ?></td>
									<td class="center"><?php echo $quota->getCreatedAt(); ?></td>                           
								</tr>
                                                                <?php endforeach; ?>
							  </tbody>
						 </table>  
					</div>
				</div><!--/span-->
			</div>